home *** CD-ROM | disk | FTP | other *** search
- ##########################################################
- # GDIdB demo script (c) 1997 Global Data Industries
- # Datasource=workweb.mdb (Access database)
- #
- # In this example, SQL queries are made to extract the
- # different categories of jobs contained in a single
- # database table. Because the jobs in each category are
- # the result of a database search, care is needed to define
- # SQL search criteria that will accurately sort the data.
- # It is always possible that some jobs will not be included
- # under any category, and that some jobs will be included
- # in several categories.
- ##########################################################
-
-
-
- ##########################################################
- # variable catpagecount is used to generate a unique link
- # for each of the category pages, and for the pages linked
- # under each category. It is incremented once for each
- # category produced.
-
- &defvar(?catpagecount?)
- &assign(?catpagecount?,1)
-
-
- ##########################################################
- # Print the information screen
-
- &cls
- &print("WorkWeb 2 Demo Script")
- &print("-----------------------------------")
-
-
-
- ##########################################################
- # declare the ODBC data source
-
- &datasource("Driver={Microsoft Access Driver (*.mdb)};DBQ=workweb.mdb")
-
-
-
-
- ##########################################################
- # call the subroutine that generates the top-level HTML
- # index page
-
- &indexpage
-
-
-
- ##########################################################
- # Create and fill each of the job categories using &jcat
- # subroutine. (Defined later in the script) The first
- # argument to the function is used as the category name,
- # the second is used in the SQL query to fetch relevent
- # job vacencies.
-
- # Analogue Engineers
- &jcat("Analogue Engineers","Analogue")
-
- # Software Engineers
- &jcat("Software Engineers","software")
-
- # HTML Authors
- &jcat("HTML Authors","html")
-
- # RF Engineers
- &jcat("R.F. Engineers","rf")
-
- # Hardware Engineers
- &jcat("Hardware Engineers","hardware engineer")
-
- # ASIC Engineers
- &jcat("ASIC Engineers","asic")
-
-
-
-
- ##########################################################
- # print the finishing message
-
- &msgbox("All done!",iconinformation)
- &cls
- &print("Demo web site HTML generation complete. Click the HTML button to see the results.")
- &print
- &print
-
- # END OF SCRIPT
-
-
-
-
- ##########################################################
- # SUBROUTINES
-
-
- ##########################################################
- # This is the top-level page containing links to the pages
- # created from the database searches. This page is actually
- # static (it contains no database data) so could be created
- # as a normal HTML file and left on the web server.
- # It has been included in this script merely for information.
-
- &defsub("indexpage")
- {
- &html ("index.html")
- {
- <HTML>
- <HEAD>
- <TITLE>Work Web</TITLE>
- </HEAD>
- <BODY BACKGROUND="wwbg1.gif" LINK=BLACK VLINK=BLACK ALINK=WHITE>
- <FONT FACE="Verdana,Helvetica">
- <IMG SRC="ww1.gif">
- <BR><BR><BR><BR><BR><BR>
- <TABLE CELLPADDING=10 CELLSPACING=10 BORDER=0 WIDTH="100%">
- <TR>
- <TD VALIGN=TOP>
- <FONT FACE="Verdana,Helvetica">
- <FONT SIZE="+2">Select a Job Category:</FONT>
- <BR><BR>
- <UL>
-
-
- # subroutine jcat will produce all of the files that link
- # to the following links
- <LI><A HREF="cat1.html" onMouseover="window.status='View Jobs in category Analogue Engineers';return true">Analogue Engineers</A><BR>
- <LI><A HREF="cat2.html" onMouseover="window.status='View Jobs in category Software Engineers';return true">Software Engineers</A><BR>
- <LI><A HREF="cat3.html" onMouseover="window.status='View Jobs in category HTML Authors';return true">HTML Authors</A><BR>
- <LI><A HREF="cat4.html" onMouseover="window.status='View Jobs in category RF Engineers';return true">RF Engineers</A><BR>
- <LI><A HREF="cat5.html" onMouseover="window.status='View Jobs in category Hardware Engineers';return true">Hardware Engineers</A><BR>
- <LI><A HREF="cat6.html" onMouseover="window.status='View Jobs in category ASIC Designers';return true">ASIC Designers</A><BR>
- </UL>
- </FONT>
- </TD>
- <TD WIDTH="45%" VALIGN=TOP><FONT FACE="Verdana,Helvetica">
- <B>This Site</B> demonstrates the use of GDI's Database
- publishing software. A single database table consisting of
- jobs is grouped into job categories, this is merged with the web site
- HTML and passed to the web server <I>automatically.</I>
- </FONT>
- </TD>
- </TR>
- </TABLE>
- <BR><BR><BR>
- <TABLE CELLPADDING=10 CELLSPACING=10 BORDER=0 WIDTH="100%">
- <TR>
- <TD>
- <FONT FACE="Verdana,Helvetica">
- <B>System Bullet points:</B>
- <UL>
- <LI> Totally automated publishing of database and spreadsheet data using a dial-up Internet connection.
- <LI> The database does not need to be stored on the web server.
- <LI> No specialist knowledge is required by web site maintainer.
- <LI> Zero administration overhead- Just set the times/days when you
- want to update your web site from your database and forget it!
- </UL>
- </FONT>
- </TD>
- </TR>
- </TABLE>
- <CENTER>
- <FONT FACE="Helvetica">
- <BR><BR>
- <I>Web site design by:</I><BR>
- <A HREF="http://www.gd-ind.com">GLOBAL DATA INDUSTRIES</A>
- </CENTER>
- </FONT>
- </BODY>
- </HTML>
- }
- }
-
-
-
-
-
-
-
- ##########################################################
- # Subroutine jcat handles the creation of the job category
- # pages, and is called once for each job category processed.
- # The function uses values passed as arguments, these are
- # accessed in the subroutine using ?argv? variable array.
- # Note the use of nested &html functions in this subroutine,
- # where the job content page is generated 1/2 way through
- # the generation of the job category page
-
- &defsub("jcat")
- {
- &html("cat?catpagecount?.html")
- {
- &print("Creating category ?catpagecount?")
- &inc(?catpagecount?)
- <HTML>
- <HEAD>
- <TITLE>Jobs List</TITLE>
- </HEAD>
- <BODY BACKGROUND="wwbg1.gif" LINK=BLACK VLINK=BLACK ALINK=WHITE>
- <FONT FACE="Verdana,Helvetica">
- <TABLE WIDTH="80%" CELLSPACING=10 BORDER=0>
- <TR>
- <TD><IMG SRC="wwbullet1.gif"></TD>
- <TD>
- <FONT SIZE="+3" FACE="Verdana,Helvetica">
- ?argv[1]?
- </FONT>
- </TD>
- </TR>
- </TABLE>
- <UL><UL>
-
-
- # this subroutine uses functions &sql, &if and &foreachrow.
- # A slightly simpler alternative would be to use the &getdata
- # function followed by a &else function.
-
- &sql("SELECT * FROM Jobs WHERE JobDesc Like '%?argv[2]?%'")
- {
- &if (?recordsetsize?==0)
- {
- Sorry! We currently have no jobs in this category.
- }
-
-
- &foreachrow
- {
- <LI><A HREF="p?catpagecount?n?rownumber?.html" onMouseover="window.status='View Job (?JobTitle?) details.';return true">?JobTitle?</A>
- &html("p?catpagecount?n?rownumber?.html")
- {
- <HTML>
- <HEAD>
- <TITLE>Job Description</TITLE>
- </HEAD>
- <BODY BACKGROUND="wwbg1.gif">
- <TABLE WIDTH="80%" CELLSPACING=10 BORDER=0>
- <TR>
- <TD><IMG SRC="wwbullet1.gif"></TD>
- <TD>
- <FONT SIZE="+2" FACE="Verdana,Helvetica">
- ?JobTitle?
- </FONT>
- </TD>
- </TR>
- </TABLE>
- <CENTER>
- <TABLE WIDTH="90%" CELLSPACING=10 BORDER=0>
- <TR>
- <TD>
- <FONT FACE="Verdana,Helvetica"SIZE="+1">Job ref: ?JobNo?</FONT>
- <TT>
- <FONT SIZE="+1"><P>?JobDesc?</FONT></TT>
- </TD>
- </TR>
- </TABLE>
- </CENTER>
- </BODY>
- </HTML>
- }
- }
- }
-
- </UL></UL>
- </FONT>
- </BODY>
- </HTML>
- }
-
- }
-
-
-
-